package com.glacier.sys.domain;

import java.io.Serializable;

/**
 * @author glacier
 * @version v1.0.0
 * @since <pre>2017/4/15 0015</pre>
 */
public class User implements Serializable {
    private static final long serialVersionUID = 1459552861236715606L;
    private String id;
    private String username;
    private String password;
    private Integer sex;

    public User() {
    }
    
    public static long getSerialVersionUID() {
        return serialVersionUID;
    }
    
    public String getId() {
        return id;
    }
    
    public void setId(String id) {
        this.id = id;
    }
    
    public String getUsername() {
        return username;
    }
    
    public void setUsername(String username) {
        this.username = username;
    }
    
    public String getPassword() {
        return password;
    }
    
    public void setPassword(String password) {
        this.password = password;
    }
    
    public Integer getSex() {
        return sex;
    }
    
    public void setSex(Integer sex) {
        this.sex = sex;
    }
    
    @Override
    public String toString() {
        return "User{" +
                "id='" + id + '\'' +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", sex=" + sex +
                '}';
    }
	
	
	public static final class UserBuilder {
		private String id;
		private String username;
		private String password;
		private Integer sex;
		
		private UserBuilder() {
		}
		
		public static UserBuilder anUser() {
			return new UserBuilder();
		}
		
		public UserBuilder id(String id) {
			this.id = id;
			return this;
		}
		
		public UserBuilder username(String username) {
			this.username = username;
			return this;
		}
		
		public UserBuilder password(String password) {
			this.password = password;
			return this;
		}
		
		public UserBuilder sex(Integer sex) {
			this.sex = sex;
			return this;
		}
		
		public User build() {
			User user = new User();
			user.setId(id);
			user.setUsername(username);
			user.setPassword(password);
			user.setSex(sex);
			return user;
		}
	}
}
